// 非异常，直接与states进行交互。 Vuex中store数据改变的唯一方法就是mutation
// store.commit()调用 state参数为mutation 方法名字符串
export default {
	//using code : this.$store.commit('setApiToken', 'New token value');
	setApiToken(state, tokenValue) {
		state.apitoken = tokenValue;
	},
	login(state, provider) {
		state.hasLogin = true;
		state.loginProvider = provider;
	},
	logout(state) {
		state.hasLogin = false
		state.openid = null
	},
	setOpenid(state, openid) {
		state.openid = openid
	},
	setTestTrue(state) {
		state.testvuex = true
	},
	setTestFalse(state) {
		state.testvuex = false
	},
	setColorIndex(state, index) {
		state.colorIndex = index
	},
	setMatchLeftWindow(state, matchLeftWindow) {
		state.noMatchLeftWindow = !matchLeftWindow
	},
	setActive(state, tabPage) {
		state.active = tabPage
	},
	setLeftWinActive(state, leftWinActive) {
		state.leftWinActive = leftWinActive
	},
	setActiveOpen(state, activeOpen) {
		state.activeOpen = activeOpen
	},
	setMenu(state, menu) {
		state.menu = menu
	},
	setUniverifyLogin(state, payload) {
		typeof payload !== 'boolean' ? payload = !!payload : '';
		state.isUniverifyLogin = payload;
	},
	setUniverifyErrorMsg(state, payload = '') {
		state.univerifyErrorMsg = payload
	}
}